#ifndef __PDTPCTRAVERSAL_H_
#define __PDTPCTRAVERSAL_H_

#include <iostream>
#include <PDTTraversalIFC.h>
#include <PDTAbcObj.h>
#include <map>
#include <PDTPCHolder.h>

class PDTCodeGraph;
class PDTAssign;
class PDTPiAssign;
class PDTAssert;
class PDTIfElse;
class PDTWhile;

typedef map < unsigned int, PDTPCHolder * > Id2Pc_t;

class PDTPCTraversal : public Traversal {
public:
    PDTCodeGraph & cg;
    PDTNumAbcObj * pc;
    unsigned int pc_count;
    Id2Pc_t & id2pc;

    PDTPCTraversal(PDTCodeGraph & CG, PDTNumAbcObj * aPC, Id2Pc_t & aId2pc);

    // ---------------------------------------------- //
    // Visit Methods                                  //
    // ---------------------------------------------- //
    // PDTAssign
    virtual Traversal::RetType pre(PDTAssign & d);
    virtual Traversal::RetType post(PDTAssign & d);

    // PDTPiAssign
    virtual Traversal::RetType pre(PDTPiAssign & d);
    virtual Traversal::RetType post(PDTPiAssign & d);

    // PDTAssert
    virtual Traversal::RetType pre(PDTAssert & d);
    virtual Traversal::RetType post(PDTAssert & d);

    // PDTIfElse
    virtual Traversal::RetType pre(PDTIfElse & d);
    virtual Traversal::RetType post(PDTIfElse & d);
    virtual Traversal::RetType beforeChild(PDTIfElse & d, unsigned int i);
    virtual Traversal::RetType afterChild(PDTIfElse & d, unsigned int i);

    // PDTWhile
    virtual Traversal::RetType pre(PDTWhile & d);
    virtual Traversal::RetType post(PDTWhile & d);
    virtual Traversal::RetType beforeChild(PDTWhile & d, unsigned int i);
    virtual Traversal::RetType afterChild(PDTWhile & d, unsigned int i);

    // PDTListOfStatements
    virtual Traversal::RetType pre(PDTListOfStatements & d);
    virtual Traversal::RetType post(PDTListOfStatements & d);
    virtual Traversal::RetType beforeChild(PDTListOfStatements & d);
    virtual Traversal::RetType afterChild(PDTListOfStatements & d);

    // ---------------------------------------------- //
    // End of Visit Methods                           //
    // ---------------------------------------------- //
    
    unsigned int start();
};

#endif 
